#include <iostream>

using namespace std;

void PowerSet(int *arr, int len)
{
    int count = 1 << len;

    for (int i=0; i<count; i++)
    {
        cout << "Set number " << i << ": ";
        int *elements = arr;
        int temp = i;

        while (temp > 0)
        {
            if (temp & 1 == 1)
                cout << *elements << " ";
            temp = temp >> 1;
            elements++;
        }
        cout << endl;
    }
}

int main()
{
    int arr[] = {1, 2, 3, 4};
    PowerSet(arr, 4);

    return getchar();
}